package com.team.controller;

import com.team.entity.Disease;
import com.team.service.DeptService;
import com.team.service.DiseaseService;
import com.team.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : 陈灰灰
 * @Date: 2022/10/16/21:04
 * @Description:
 */
@RestController
@RequestMapping("/disease")
public class DiseaseController {
    @Autowired
    private DiseaseService diseaseService;

    /**
     * 通过预约的id查询病例信息
     *
     * @param id id
     * @return {@link Result}
     */
    @RequestMapping("/diseaseList")
    public Result selectDiseaseByReservationId(Integer id){
        System.out.println(id);
        return diseaseService.queryDiseaseByReservationId(id);
    }

    /**@author:chh
     * 增加病例
     * @param disease 病例
     * @return {@link Result}
     */
    @RequestMapping("/addDisease")
    public Result addDisease(@RequestBody Disease disease){
        return diseaseService.addDisease(disease);
    }


}
